The present invention relates generally to floating point adders. In particular, the present invention relates to normalization in floating point adders. Most particularly, the present invention relates to leading zero prediction for normalization in floating point adders/subtractors.
In typical binary floating point operations, numbers are represented by an exponent and a mantissa. The mantissa is normalized so as to have a single nonzero digit to the left of the floating point; that is, the mantissa will be less than 2.0 and greater than or equal to 1.0. The most significant digit of the mantissa is sometimes called the hidden bit because according to some standards, such as the IEEE 754-1985 standard, this bit is not stored, because by definition of the format it is known to be a 1.
When two floating point operands are subtracted, the exponents are compared by subtraction, one of the operand mantissas is preshifted by the exponent difference and then the mantissas are subtracted (normally done by two's complement addition). If the numbers were originally close in value, the mantissa subtraction result may have a number of leading zeros. In order to normalize the result and put it into correct floating point representation, the mantissa must be left shifted to remove leading zeros and the exponent incremented accordingly. If leading zero detection is performed after the subtraction operation is complete, valuable time is wasted. Current floating point adders/subtractors typically perform some sort of prenormalization or leading zero anticipation in parallel with the subtraction process; a typical circuit is shown in FIG. 1. Operands A and B, reference numerals 1 and 2 respectively, are stored in register 10 and provided to subtractor 20, which computes the difference A-B. At the same time,. the operands are provided to a leading zero anticipator (LZA) 30 that attempts to determine the number of leading zeros of the subtraction result, without actually doing the full subtraction, of course. The subtraction result 25 is then shifted in shifter 40 according to the result 35 from LZA 30. For some combinations of A and B, however, LZA 30 will incorrectly anticipate the number of leading zeros and the shifted result 45 will not be normalized, by a factor of one shift. For this reason, adjust-by-one normalization corrector 50 is required to determine whether shifted result 45 is correctly normalized, and shift it one bit if it is not, to produce normalized result 60. The need for normalization corrector 50 undesirably slows down subtraction operations.